<template>
  <div style="text-align: right;margin-top: 20px;">
    <el-pagination
      background
      :current-page.sync="currentPage"
      layout="prev, pager, next, total, slot"
      :page-size="pageSize"
      :total="total"
      @current-change="changePage"
    >
      <span style="font-weight: normal;">每页{{ pageSize }}条</span>
    </el-pagination>
  </div>
</template>

<script>
import {Pagination} from 'element-ui';

export default {
  components:{
    [Pagination.name]:Pagination
  },
  props: {
    total: {
      type: Number,
      default: 0,
    },
    pageSize: {
      type: Number,
      default: 0,
    },
  },
  data () {
    return {
      // 当前页，每次点击查询按钮需初始化查询页
      currentPage: 1,
    };
  },
  methods: {
    changePage (current) {
      this.$emit('page-change', current);
    },
  },
};
</script>

<style>

</style>
